package aapilast3;

import aapilast3.anno.AutoRunMethod1;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class<?> cls = Class.forName("aapilast3.Person");
        Method method = cls.getMethod("sayHi");
        if (method.isAnnotationPresent(AutoRunMethod1.class)){
            AutoRunMethod1 arm = method.getAnnotation(AutoRunMethod1.class);
            int value = arm.value();
            System.out.println(value);
        }
    }
}
